/*
 * @Author: your name
 * @Date: 2021-03-29 19:05:34
 * @LastEditTime: 2021-04-22 18:04:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \inventory-apie:\hjimi\人脸辨识云\html\visitorOrder\main.js
 */
import Vue from 'vue'
import App from './App'
import store from './commom/js/store'
import nodeMsg from './commom/js/nodeMsg'


// 配置数据请求函数
// import uniRequest from 'uni-request';//数据请求
// uniRequest.defaults.baseURL = 'http://192.168.10.148:8765/api/';
// uniRequest.defaults.headers.common['Authorization'] = 'AUTH_TOKEN';
// uniRequest.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
// ------------
// tips:
// 	请求方法的别名
// 	uniRequest.request(config)
// 	uniRequest.get(url[, config])
// 	uniRequest.delete(url[, config])
// 	uniRequest.head(url[, config])
// 	uniRequest.options(url[, config])
// 	uniRequest.post(url[, data[, config]])	
// 	uniRequest.put(url[, data[, config]])
// 	uniRequest.patch(url[, data[, config]])
// ------------

// 全局底部导航
import tabBar from './components/tabBar/tabBar'
Vue.component('tabBar', tabBar)


// 全局引入各带有 tabBar页面
import index from './pages/index/index.vue'
Vue.component('index', index)

import my from './pages/my/my.vue'
Vue.component('my', my)

Vue.config.productionTip = false;
Vue.prototype.$nodeMsg = nodeMsg; //定义获取节点信息的前置变量,组件中用法:this.$nodeMsg.Nodes.n
App.mpType = 'app';

Vue.prototype.BASEURL = 'https://visitor.weixin.cloud.hjimi.com/wx/';

Vue.prototype.APPID = 'wx1fc1f685f40b5f12';
// Vue.prototype.SECRET
// Vue.prototype.WX_AUTH_URL 

// uni.setStorage({
// 	key: 'openId',
// 	data: 'oEkE841QeAWTs6JD6PYGEdQktQzc'
// });

uni.getSetting({
	success(res) {
		if (!res.authSetting['scope.userInfo']) {
			console.log("未授权")
			uni.reLaunch({
				url: '../login/login'
			})
		} else {
			// uni.reLaunch({
			// 	url:'../home/home'
			// })
			console.log("当前已授权")
		}
	}
})

const app = new Vue({
	store,
	nodeMsg,
	// BASEURL,
	...App
})
app.$mount()
